clear
set more off

* FIGURE 2

use "E:\Cuong - paper\COVID\governance_inequality_graph.dta", clear
	for var response lockdown transport nonbusi mobility gathering fines masks interact1 interact2: gen X_l=X-1.96*X_se
	for var response lockdown transport nonbusi mobility gathering fines masks interact1 interact2: gen X_u=X+1.96*X_se
	
	* for var response lockdown transport nonbusi mobility gathering fines masks interact1 interact2: replace X=round(X, 0.001)
	
	
	twoway (rcap response_l response_u order, ytitle(Effect on 'Believe in the government's response') xtitle(Income quintile) legend(off)) ///
		(scatter response order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(response) graphregion(color(white)))

	
	twoway (rcap lockdown_l lockdown_u order, ytitle(Effect on 'Believe in shutting down schools') xtitle(Income quintile) legend(off)) ///
		(scatter lockdown order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(lockdown) graphregion(color(white)))

		
	twoway (rcap transport_l transport_u order, ytitle(Effect on 'Believe in shutting public transport') xtitle(Income quintile) legend(off)) ///
		(scatter transport order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(transport) graphregion(color(white)))

	twoway (rcap nonbusi_l nonbusi_u order, ytitle(Effect on 'Believe in shutting down non-essential business') xtitle(Income quintile) legend(off)) ///
		(scatter nonbusi order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(nonbusi) graphregion(color(white)))

		
		twoway (rcap mobility_l mobility_u order, ytitle(Effect on 'Believe in limiting mobility outside home') xtitle(Income quintile) legend(off)) ///
		(scatter mobility order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(mobility) graphregion(color(white)))

		
		
		twoway (rcap gathering_l gathering_u order, ytitle(Effect on 'Believe in forbidding mass gatherings') xtitle(Income quintile) legend(off)) ///
		(scatter gathering order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(gathering) graphregion(color(white)))

		
		
		twoway (rcap fines_l fines_u order, ytitle(Effect on 'Believe in introducing fines for citizens') xtitle(Income quintile) legend(off)) ///
		(scatter fines order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(fines) graphregion(color(white)))

		
		twoway (rcap masks_l masks_u order, ytitle(Effect on 'Believe in requiring masks to be worn outside') xtitle(Income quintile) legend(off)) ///
		(scatter masks order, connect(direct) yline(0) ylabel(-0.3(0.1)0.2) xlabel(1 "Quintile 1" 2 "Quintile 2" 3 "Quintile 3" 4 "Quintile 4" 5 "Quintile 5") mlabel(masks) graphregion(color(white)))

		
* FIGURE 3
* Interactions

	use "E:\Cuong - paper\COVID\governance_inequality_interaction.dta", clear

		replace order=order+0.1 if sample==2
		for var qt1: gen X_l=X-1.96*X_se
		for var qt1: gen X_u=X+1.96*X_se
	
		for var qt1: replace X=round(X, 0.001)

		sort gini
		
		twoway (rcap qt1_l qt1_u order if sample==1, ytitle(Interactions between Gini and income quintiles) xtitle(Country (Gini index))) ///
		(scatter qt1 order if sample==1, connect(direct) yline(0) ylabel(-2(0.5)1) xlabel(1 "Japan(25.6)" 2 "S.Kor(32.7)" 3 "UK(33.3)" 4 "Italy(33.7)" 5 "US(38.2)" 6 "China(40.9)") mlabel(qt1)) ///
		(rcap qt1_l qt1_u order if sample==2, ytitle(Interactions between Gini and income quintiles)) ///
		(scatter qt1 order if sample==2, connect(direct) yline(0) ylabel(-2(0.5)1) mlabel(qt1) graphregion(color(white)))

